import java.util.Scanner;

public class BookPurchase1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入图书的定价：");
        double price = scanner.nextDouble();
        System.out.print("请输入购买图书的数量：");
        int quantity = scanner.nextInt();
        scanner.close();

        double totalPrice = calculateTotalPrice(price, quantity);
        System.out.println("购书的总金额为：" + totalPrice);
    }

    public static double calculateTotalPrice(double price, int quantity) {
        //定义 折扣
        double discount;
        if (quantity > 100) {
            discount = 0.8;
        } else if (quantity > 10) {
            discount = 0.85;
        } else {
            discount = 0.9;
        }
        return price * quantity * discount;
    }
}